{extend name="web/public/base" /}
{block name="header"}
{/block}
{block name="main"}
<section class="scrollable padder">
    <ul class="breadcrumb no-border no-radius b-b b-light pull-in">
        <li class="active">{$title}</li>
    </ul>
    <div class="row">
        <div class="col-sm-12">
            <section class="panel panel-default">
                <header class="panel-heading"> {$title}</header>

                {notempty name="_list"}
                <div class="table-responsive">
                    <table class="table table-striped table-hover b-t b-light text-sm">
                        <thead>
                        <tr>
                            <th width="80px">ID号</th>
                            <th>会员账号</th>
                            <th>收货地址</th>
                            <th>收货人</th>
                            <th>联系方式</th>
                            <th>状态</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        {volist name='_list' id='vo'}
                        <tr>
                            <td>{$vo.id}</td>
                            <td>{$vo.usernumber}</td>
                            <td>{$vo.addressInfo.address}</td>
                            <td>{$vo.addressInfo.realname}</td>
                            <td>{$vo.addressInfo.mobile}</td>
                            <td>
                                {if condition="$vo['status'] == 0"}
                                未发放
                                {else/}
                                已发放
                                {/if}
                            </td>
                            <td>
                                {if condition="$vo['status'] == 0"}
                                <a class="btn btn-success" title="发放奖励" onclick="bonus({$vo.id});return false;">发放奖励</a>
                                {else/}
                                无
                                {/if}
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
                {else/}
                <div style="text-align: center">
                    <image src="__PUBLIC__/images/empty.jpg"></image>
                </div>
                {/notempty}
            </section>
        </div>
    </div>
</section>
{/block}
{block name="script"}
<script type="text/javascript">

    function bonus(id) {
        $.post("{:url('bonus')}", {id: id}, function (data) {
            layer.msg(data.msg);
            if (data.code == 1) {
                setTimeout(function () {
                    window.location.reload()
                }, 2000);
            }
        }, 'json')
    }

</script>
{/block}

